<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
<%@ taglib uri="/WEB-INF/struts-nested.tld" prefix="nested" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-template.tld" prefix="template" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<html:html>
<head>
<title>EPrice ~ Listado de Productos </title>
<link href="<bean:write name="path"/>/css/estilos.css" rel="stylesheet" type="text/css"/>
</head>
<%
String str_cliente = request.getParameter("str_cliente");
%>
<script language="javascript" type="">
function enviaParam(str_codigo, str_descripcion){
  try{
		var clienteArticuloUnidad = window.opener.document.forms[0];
		// window.opener.document.getElementById('str_codigoProd').value=str_codigo;
    	// window.opener.document.getElementById('str_descripcionProd').value=str_descripcion;

		clienteArticuloUnidad.str_codigoProd.value = str_codigo;
    	clienteArticuloUnidad.str_descripcionProd.value = str_descripcion;

    	window.opener.focus();
  }catch(e){
    alert(e);
	throw e;
  }finally{
	window.close();

	}
}
</script>
<body>
<html:form action="buscarProducto" method="get" focus="str_search">
  <html:hidden property="service" value="listarProductoClienteArticuloUnidad"/>
  <html:hidden property="str_cliente" value="<%=str_cliente%>"/>
  <br>
  <table width="80%" border="0" align="center" cellpadding="0" cellspacing="1" class="tabla">
  <tr class="encabezadoTabla">
    <td colspan="3">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="30">&nbsp;<img width="17" height="23" src="<bean:write name="path"/>/images/img_loginFlecha.gif" alt=""/></td>
          <td>&nbsp;&nbsp;<strong class="font_general">Listado de Productos  </strong></td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td height="0" colspan="3"></td>
  </tr>
  <tr class="encabezado_col font_general">
    <td colspan="3" align="center">Producto:&nbsp;&nbsp;
      <html:text styleClass="textfield" property="str_search"/>&nbsp;&nbsp;&nbsp;
      <html:submit styleClass="boton" value="Buscar" property="btn_buscar"/>
    </td>
  </tr>
  <tr>
    <td height="0" colspan="3"></td>
  </tr>
  <tr>
    <td width="9%" align="center" class="encabezado_col font_general">&nbsp;</td>
    <td width="14%" align="center" class="encabezado_col font_general">Codigo</td>
    <td width="77%" align="center" class="encabezado_col font_general">Descripcion</td>
  </tr>
  <logic:iterate id="producto" name="arrL_producto" indexId="int_i">
    <tr>
      <td align="center" class="font_general <%=int_i.intValue()%2==0?"":"im"%>par">
      	<a href="#" onclick='enviaParam("<bean:write name='producto' property='str_codProd'/>", "<bean:write name='producto' property='str_descProd'/>");'>
      	<img width="15" height="15" border="0" src="<bean:write name="path"/>/images/img_add.gif" alt=""/>
      	</a>
      </td>
      <td align="center" class="font_general <%=int_i.intValue()%2==0?"":"im"%>par"><bean:write name="producto" property="str_codProd"/></td>
      <td align="left" class="font_general <%=int_i.intValue()%2==0?"":"im"%>par">&nbsp;<bean:write name="producto" property="str_descProd"/></td>
    </tr>
  </logic:iterate>
</table>
  <br>
</html:form>
</body>
</html:html>
